<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <script>
            // 用js递归的方式写1到100求和？
            function add(num1, num2) {
                var num = num1 + num2;
                if (num2 + 1 > 100) {
                    return num;
                } else {
                    return add(num, num2 + 1);
                }
            }
            var sum = add(1, 2);

            let a = 5;
            b = a++; // 5
            console.log(b); // 5
            console.log(a); // 6
            c = ++a;
            console.log(c); // 7
        </script>
    </body>
</html>
